﻿Public Class AppSettingsWriter
    Public Sub SetValue(ByVal key As String, ByVal value As String)
        Dim ds As New DataSet()
        ds.ReadXml("App.config")
        Dim dr() As DataRow = ds.Tables("add").Select(String.Concat("key='", key, "'"))
        dr(0).Item("value") = value
        ds.WriteXml("App.config")
        ds.Clear()

      
    End Sub
    Public Shared Function GetValue(ByVal key As String) As String
        Dim ds As New DataSet()
        ds.ReadXml("App.config")
        Dim dr() As DataRow = ds.Tables("add").Select(String.Concat("key='", key, "'"))
        Dim v As String = dr(0).Item("value").ToString()

        ds.Clear()
        Return v
    End Function
End Class
